<template>
    <div class="blog-project-box">
        <div class="blog-project-item animate__animated animate__backInDown" v-for="item in 6" :key="item">
            <!-- <div class="list-item" v-for="item in 8" :key="item"> -->
            <div class="blog-item-title">SpringMVC-01-回顾MVC架构</div>
            <div class="blog-item-content">
                <img src="@/assets/imgs/avatar.jpg" class="blog-item-avatar" alt="">
                <div class="blog-item-info">1、什么是MVC MVC是模型(Model)、视图(View)、控制器(Controller)的简写，是一种软件架构模式。
                    它通过将业务逻辑、页面控制、显示视图分离的方法来组织代码。 主要作用是降低了视图与业务逻辑间的双向偶合。 它不是一种设计模式，而是一种架构模式。当然不同的MVC存在差异。 Mo ...
                </div>
            </div>
            <div class="blog-author">
                <span class="blog-author-name">程序员</span>
                <span class="blog-time">2024-06-26 13:50</span>
                <span class="blog-view" @click="giveUp">
                    <el-icon>
                        <Pointer :color="color" />
                    </el-icon>
                    <span class="view-num" :style="{ 'color': color }">{{ giveUpNumber }}</span>
                </span>
                <span class="blog-view">
                    <el-icon>
                        <View />
                    </el-icon>
                    <span class="view-num">1000</span>
                </span>
                <!-- </div> -->
            </div>
        </div>
    </div>
</template>

<script setup lang="ts">
import { ref } from 'vue';
let color = ref <string> ( '#333' )
let giveUpNumber = ref <number> ( 100 )
let giveUp = () => {
    color.value = '#f40'
    giveUpNumber.value++
}

</script>

<style lang="scss" scoped>
.blog-project-box {
    width: 100%;
    height: 700px;
    // overflow-y: auto;
    // background-color: #ffa;
    border-radius: 20px;
    margin-top: 70px;
    box-sizing: border-box;
    padding: 0 20px;
    margin-bottom: 30px;
}

.blog-project-item {
    width: 100%;
    height: 200px;
    border-radius: 20px;
    background-color: #ffe;
    margin-bottom: 20px;
}

.blog-project-item {
    width: 100%;
    height: 150px;
    border-bottom: 1px solid #efefef;
    padding: 20px;
}

.blog-item-title {
    font-size: 16px;
    font-weight: 600;
    color: #005dae;
    cursor: pointer;
    text-decoration: underline;
}

.blog-item-title:hover {
    color: red;

}
.blog-item-avatar{
    width: 50px;
    height: 50px;
}

.blog-item-content {
    margin: 15px 0;
    display: flex;
    justify-content: space-between;

    img {
        margin: 3px 5px 0 0;
    }
}

.blog-item-info {
    font-size: 12px;
    color: #555;
    line-height: 20px;
}

.blog-author {
    display: flex;
    font-size: 13px;

    span {
        margin-right: 20px;
    }
}

.blog-author-name {
    color: #005dae;
}

.blog-view {
    cursor: pointer;
    display: flex;
    align-items: center;
}
</style>